/**
 * 枚举类-系统
 */

//角色枚举
export enum RoleEnum {
  SUPER = 'super',
  TEST = 'test',
}

//缓存类型枚举
export enum CacheTypeEnum {
  SESSION,
  LOCAL,
}

//http: 请求头
export enum HttpHeadEnum {
  TOKEN = 'X-Access-Token',
  AUTHENTICATION = 'Authorization',         // springSecurity的token
  TIMESTAMP = 'X-TIMESTAMP',                // 时间戳
  TENANT_ID = 'X-Tenant-Id',                // 租户id
}

//http: contentTyp
export enum ContentTypeEnum {
  JSON = 'application/json;charset=UTF-8',                              // json
  FORM_DATA = 'multipart/form-data;charset=UTF-8',                      // form-data  upload
  FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8',  // form-data qs
}

//http: 响应
export enum ResultEnum {
  SUCCESS = 0,
  ERROR = 1,
  FAIL = 500,           //错误
  UNAUTHORIZED = 401,   //未认证
  TIMEOUT = 504,        //超时
  TYPE = 'success',
}

//异常相关枚举
export enum ExceptionEnum {

  PAGE_NOT_ACCESS = 403,      // 页面无法访问
  PAGE_NOT_FOUND = 404,       // 页面找不到
  ERROR = 500,                // 页面error
  PAGE_NOT_DATA = 10100,      // 页面无数据

  NET_WORK_ERROR = 10000,     //网络错误

  PHONE_SMS_FAIL_CODE = 40002,  //短信验证码次数太多失败code，用于判断是否打开弹窗
}

//错误类型枚举
export enum ErrorTypeEnum {
  VUE = 'vue',
  SCRIPT = 'script',
  RESOURCE = 'resource',
  AJAX = 'ajax',
  PROMISE = 'promise',
}

//页面枚举
export enum PageEnum {
  BASE_LOGIN = '/login',
  BASE_HOME = '/dashboard/analysis',    //首页
  TENANT_PAGE = '/tenant/MyTenantList',    //租户页
  ERROR_PAGE = '/exception',            // error page
  ERROR_LOG_PAGE = '/error-log/list',   // error log page
  OAUTH2_LOGIN_PAGE_PATH = '/oauth2-app/login',   // auth2登录路由路径
  TOKEN_LOGIN = '/tokenLogin'           // 邮件中的跳转地址
}

//页面常量枚举
export enum PageConstantEnum {
  REDIRECT_NAME = 'Redirect',
  REDIRECT_ROUTE_NAME = 'RedirectTo',
  PARENT_LAYOUT_NAME = 'ParentLayout',
  PAGE_NOT_FOUND_NAME = 'PageNotFound',
  // vue-router4.5.0版本路由name:PageNotFound同名导致登录进不去
  PAGE_NOT_FOUND_NAME_404 = 'PageNotFound404',
}